package cn.wl.gulimall.order;

import org.springframework.amqp.rabbit.annotation.EnableRabbit;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;

/**
 * Seata 控制分布式事务
 * 1.每一个微服务先必须创建undo_log;
 * 2.安装事务协调器;seata-server
 * 3.整合
 *      1.导入依赖 spring-cloud-starter-alibaba-seata seata-all 0.7.1
 *      2.解压并启动启动seata-server;  修改rgistry type=nacos
 *      3.所有想要用到分布式事务的微服务使用seata DataSourceProx代理自己的数据源
 *      4.每个微服务，都必须导入
 *      registry.conf
 *      file.conf  vgroup_mapping.gulimall-ware-fescar-service-group = "default"
 *      5.给分布式大事务的入口标注@GlobalTransactional
 *      6.每一个远程的小事务用@Transactional
 */
//exposeProxy = true对外暴露代理对象
//本类互掉用代理对象
@EnableAspectJAutoProxy(exposeProxy = true)
@EnableFeignClients
@EnableRabbit
@EnableRedisHttpSession
@EnableDiscoveryClient
@SpringBootApplication
public class GulimallOrderApplication {

    public static void main(String[] args) {
        SpringApplication.run(GulimallOrderApplication.class, args);
    }

}
